import { reactive } from "vue";
import { ListMixins, type ApiMethod } from "./listMinixs";
import { onMounted,onUnmounted  } from "vue";

export class BaseController {
	constructor(){
		onMounted(this.onMounted.bind(this))
		onUnmounted(this.onUnmounted.bind(this))
	}

	protected onMounted(){

	}
	protected onUnmounted(){

	}
}

export class BaseControllerWithList<T> extends ListMixins<T> {
	constructor(params:{api:ApiMethod<T>,size?:number}){
		super(params)
		onMounted(this.onMounted.bind(this))
		onUnmounted(this.onUnmounted.bind(this))
	}

	protected onMounted(){

	}
	protected onUnmounted(){

	}
}
